Mons, 2019-03-21
Fabrice Flore-Thebault
User & contributor in Molecule / Ansible ecosystem.
Free Software Infrastructure Automation.
Culture, Automation, Measurement, Sharing.
Day 2 routines: system patches, audit, inventory.
Reproductible provisioning, from hypervisor to apps.
Automated backup & restore data.
Maintain environments on shared hosting platforms.
Deploy software.
Build CI pipelines.
Manage everything API: network, cloud, kubernetes.
Validate roles and playbooks before production
Instantiate temporary infrastructure

| Ansible is NOT a programing language |
Molecule has many friends in the toolbox.
Ansible ecosystem
Platforms backends
Dependency backends
Verifiers
Ansible is an IT automation tool. It can configure systems, deploy software, and orchestrate more advanced IT tasks such as continuous deployments or zero downtime rolling updates. Ansible’s main goals are simplicity and ease-of-use.
Molecule is designed to aid in the development and testing of Ansible roles. […] Molecule is opinionated in order to encourage an approach that results in consistently developed roles that are well-written, easily understood and maintained.
Improve the roles quality.
Kill opinion wars.
Ansible Lint is a commandline tool for linting playbooks. Use it to detect behaviors and practices that could potentially be improved.
(local) Virtualization
Cloud provider
Bake your own
Docker
LXC
LXD
Vagrant
Azure
EC2
GCE
Linode
Openstack
| Slow! Keep it for specific cloud features, Windows. |
Delegated
Audit the state of the tested platform after role execution with an independant tool.
Testinfra
Goss
Inspec
Default verifier.
Write tests in python.
Public == python developers.
With Testinfra you can write unit tests in Python to test actual state of your servers configured by management tools.
Easy. YAML syntax, fit well in the Ansible ecosystem.
Fast. Near instantaneous.
Small. <10MB single self-contained binary.
Linux only.
Goss is a YAML based serverspec alternative tool for validating a server’s configuration.
Complex, ruby based, with a feature full DSL.
Linux, MacOS and Windows support.
Public == ruby developers.
InSpec is compliance as code. Turn your compliance, security, and other policy requirements into automated tests.
Usage: molecule [OPTIONS] COMMAND [ARGS]...
_____ _ _
| |___| |___ ___ _ _| |___
| | | | . | | -_| _| | | | -_|
|_|_|_|___|_|___|___|___|_|___|
Molecule aids in the development and testing of Ansible roles.
Enable autocomplete issue:
eval "$(_MOLECULE_COMPLETE=source molecule)"
Options:
--debug / --no-debug Enable or disable debug mode. Default is disabled.
-c, --base-config TEXT Path to a base config. If provided Molecule will
load this config first, and deep merge each
scenario's molecule.yml on top.
(/home/fab/.config/molecule/config.yml)
-e, --env-file TEXT The file to read variables from when rendering
molecule.yml. (.env.yml)
--version Show the version and exit.
--help Show this message and exit.
Commands:
check Use the provisioner to perform a Dry-Run...
cleanup Use the provisioner to cleanup any changes...
converge Use the provisioner to configure instances...
create Use the provisioner to start the instances.
dependency Manage the role's dependencies.
destroy Use the provisioner to destroy the instances.
idempotence Use the provisioner to configure the...
init Initialize a new role or scenario.
lint Lint the role.
list Lists status of instances.
login Log in to one instance.
matrix List matrix of steps used to test instances.
prepare Use the provisioner to prepare the instances...
side-effect Use the provisioner to perform side-effects...
syntax Use the provisioner to syntax check the role.
test Test (lint, destroy, dependency, syntax,...
verify Run automated tests against instances.